package com.wondersgroup.fjzlpt.console.controller.rest.bqxx;

import com.alibaba.fastjson.JSONObject;
import com.quick.framework.boot.web.utils.RequestUtils;
import com.quick.framework.util.QuickPrincipalUtils;
import com.wondersgroup.fjzlpt.console.service.inter.bqxx.BqxxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 病区信息服务
 * Created by lion on 2017/8/14.
 */
@RestController
@RequestMapping("/bqxx")
public class BqxxRestController {

    @Autowired
    private BqxxService bqxxService;

    @RequestMapping("/queryPageBqxx")
    public JSONObject queryPageBqxx(HttpServletRequest request)
    {
        String xzqh = QuickPrincipalUtils.getXzqhdm(request);
        Map map = RequestUtils.GetParameterMap(request);
        map.put("XZQHDM",xzqh);
        return bqxxService.queryPageBqxx(map);
    }

    @RequestMapping("/saveBqxx")
    public JSONObject saveBqxx(HttpServletRequest request){
        Map map = RequestUtils.GetParameterMap(request);
        return bqxxService.save(map);
    }

    @RequestMapping("/deleteBqxx")
    public JSONObject deleteBqxx(HttpServletRequest request){
        Map map = RequestUtils.GetParameterMap(request);
        return bqxxService.delete(map);
    }
}
